use Test::More tests => 5;
use Waya::Coordinate;
BEGIN { use_ok('Waya::Board') }

sub neighbors_ok {
    my $b     = shift;
    my $pos   = shift;
    my $coord = Waya::Coordinate->new(x => $pos->[0], y => $pos->[1]);
    is_deeply(
        [ $b->neighbors(
            Waya::Coordinate->new(x => $pos->[0], y => $pos->[1])
        ) ],
        [ map { Waya::Coordinate->new(x => $_->[0], y => $_->[1]) } @_ ],
        sprintf('neighbors of %s', $coord->as_list),
    );
}

my $b = Waya::Board->new;
is($b->board_size, 19, 'default board size 19');
neighbors_ok($b, [3,  4] => [2, 4], [4, 4], [3, 3], [3, 5]);
neighbors_ok($b, [1, 15] => [2, 15], [1, 14], [1, 16]);
neighbors_ok($b, [1, 19] => [2, 19], [1, 18]);
